package cn.gson.crm.controller.studentdetail;

import java.util.List;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.StudentDetailDao;
import cn.gson.crm.model.entity.StudentDetail;

/**
 * Servlet implementation class PayedALLServlet
 */
@WebServlet("/allpayed")
public class PayedALLServlet extends BaseServlet {
	/**
	 * 已缴清学员
	 */
	private static final long serialVersionUID = 1L;
    private StudentDetailDao  stupayDao = new StudentDetailDao();
    @Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String p = request.getParameter("page");
		String name =request.getParameter("name");
		if (p == null|| p.isEmpty()) {
			p= "1";
		}
		Integer page = Integer.parseInt(p);
		//获取已缴清学费学员
		List<StudentDetail> stuList = stupayDao.getStudentList(page,"正常", "已分配", name, 2);
		int totalPage = stupayDao.getTotalPage("正常", "已分配", name, 2);
		request.setAttribute("page", page);
		request.setAttribute("stuList",stuList);
		request.setAttribute("totalPage", totalPage);
		request.setAttribute("queryString",noPageQueryString(request) );
		getServletPathAndForward(request, "student/paystatus.jsp");
	}

}
